package com.team.engine.fileupload.service;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.team.engine.basedao.BaseEntity;
import com.team.engine.fileupload.dao.TFileDaoImpl;
import com.team.engine.fileupload.dao.TFilegroup;
import com.team.engine.fileupload.dao.TFilegroupDaoImpl;
import com.team.engine.util.QuickDao;
import com.team.engine.util.SubPage;

@Service
@Scope("prototype")
public class FileuploadServiceImpl {

	@Resource
	private TFileDaoImpl tFileDaoImpl;
	
	@Resource
	private TFilegroupDaoImpl tFilegroupImpl;
	
	@Resource
	private QuickDao<? extends BaseEntity, ?> quickDao;
	
	public SubPage<TFilegroup> getFilegroupAll(String pageNum){
//		return this.tFilegroupImpl.selectAll(pageNum==null?0:Integer.parseInt(pageNum));
		
		QuickDao<TFilegroup, String> dao = (QuickDao<TFilegroup, String>) this.quickDao;
		return dao.getInstance(TFilegroup.class).selectAll(pageNum==null?0:Integer.parseInt(pageNum));
	}
	
	public void setQuickDao(QuickDao<? extends BaseEntity, ?> quickDao) {
		this.quickDao = quickDao;
	}
	public void settFileDaoImpl(TFileDaoImpl tFileDaoImpl) {
		this.tFileDaoImpl = tFileDaoImpl;
	}
	public void settFilegroupImpl(TFilegroupDaoImpl tFilegroupImpl) {
		this.tFilegroupImpl = tFilegroupImpl;
	}
}
